﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:my="clr-namespace:InsuranceAdjuster.Web.Models" 
    xmlns:my1="clr-namespace:InsuranceAdjuster.Web.Services" 
    xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Controls="clr-namespace:SilverlightContrib.Controls;assembly=SilverlightContrib.Controls" x:Class="InsuranceAdjuster.Views.BranchView" 
    mc:Ignorable="d"
    Width="1000" Height="660"
    >
	<UserControl.Resources>
		<Style x:Key="ColorPickerRectangleStyle" TargetType="Rectangle">
			<Setter Property="Height" Value="50"/>
			<Setter Property="Width" Value="100"/>
		</Style>
		
		    <Style TargetType="TextBox">
			    <Setter Property="FontFamily" Value="Segoe"/>
			    <Setter Property="VerticalAlignment" Value="Center"/>
			    <Setter Property="FontSize" Value="18"/>
			    <Setter Property="Width" Value="120"/>
		    </Style>
	</UserControl.Resources>
    
	<UserControl.DataContext>
		<Binding Path="Branch" Source="{StaticResource Locator}"/>
	</UserControl.DataContext>

    <Grid x:Name="LayoutRoot" Margin="10">
			<Grid.RowDefinitions>
            <RowDefinition Height="{StaticResource TitleBarHeight}"/>
				<RowDefinition Height="500"/>
			</Grid.RowDefinitions>
			<Rectangle Style="{StaticResource YellowRectangleStyle}" Grid.Row="1" Margin="8,-4,-8,4"/>
			<sdk:Label Content="Branch Name" VerticalAlignment="Top" Margin="37,34,0,0" HorizontalAlignment="Left" Grid.Row="1" x:Name="lblBranchName"/>
        <TextBox HorizontalAlignment="Left" Text="{Binding SelectedBranchOffice.Name, Mode=TwoWay}" Margin="176,30,0,0" Foreground="{StaticResource MainTextColor}" VerticalAlignment="Top" Width="470" BorderThickness="0" Grid.Row="1" FontWeight="Bold"/>
			<sdk:Label Content="Address" Margin="37,75,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Row="1"/>
        <TextBox HorizontalAlignment="Left" Text="{Binding SelectedBranchOffice.AddressLine1, Mode=TwoWay}" BorderThickness="0" Foreground="{StaticResource MainTextColor}"  Margin="176,71,0,0" VerticalAlignment="Top" Width="470" Grid.Row="1"/>
        <TextBox HorizontalAlignment="Left" Text="{Binding SelectedBranchOffice.AddressLine2, Mode=TwoWay}" BorderThickness="0" Margin="176,102,0,0"  Foreground="{StaticResource MainTextColor}" VerticalAlignment="Top" Width="470" Height="32" Grid.Row="1"/>
        <TextBox Text="{Binding SelectedBranchOffice.City, Mode=TwoWay}" Width="Auto" Margin="176,143,334,0" VerticalAlignment="Top" Foreground="{StaticResource MainTextColor}" BorderThickness="0" Grid.Row="1"/>





		<!-- State ComboBox-->
        <ComboBox x:Name="stateComboBox" Width="80" Margin="463,184,437,0" Foreground="{StaticResource MainTextColor}" VerticalAlignment="Top" Height="33" Grid.Row="1" 
                ItemsSource="{Binding States}" 
				SelectedValue="{Binding SelectedBranchOffice.StateCode, Mode=TwoWay}"  
				SelectedValuePath="StateCode" 
				Template="{StaticResource ComboBoxControlTemplate2}" 
				/>


            <!--Databinding Debugging-->
            <TextBox HorizontalAlignment="Left" Width="99" BorderThickness="0" Margin="547,184,0,0" Grid.Row="1" VerticalAlignment="Top" Height="33"
					Text="{Binding SelectedBranchOffice.Zip, Mode=TwoWay}" />

        

        
        
        
        
        
        
        
        <sdk:Label Content="Phone" Margin="37,188,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Row="1"/>
        <TextBox Text="{Binding SelectedBranchOffice.Phone, Mode=TwoWay}" Margin="176,184,0,0" VerticalAlignment="Top" Width="283" Foreground="{StaticResource MainTextColor}" BorderThickness="0" Grid.Row="1" HorizontalAlignment="Left"/>
			<Border Padding="10" Background="White" Margin="30,0,0,46" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="189" Width="616" Grid.Row="1">
				<Grid Background="White" Height="170" Width="596" >
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition Height="0*" />
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
					</Grid.ColumnDefinitions>
					<sdk:Label Content="Backcolor" Grid.Row="0" Margin="22,61,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
					<sdk:Label Content="Forecolor" HorizontalAlignment="Left" Margin="24,0,0,42" VerticalAlignment="Bottom" />
					<Rectangle Name="backgroundColorRect" Fill="{Binding BranchStyle.BackgroundBrush, Mode=TwoWay}" Stroke="Black" HorizontalAlignment="Left" Style="{StaticResource ColorPickerRectangleStyle}" Margin="111,48,0,72" d:LayoutOverrides="HorizontalAlignment" MouseLeftButtonUp="BackColor_MouseLeftButtonUp" />
                    <TextBox x:Name="headingBackgroundColorTextBox" HorizontalAlignment="Left" Text="{Binding BranchStyle.BackgroundBrush.Color, Mode=TwoWay}" Margin="236,57,0,0" VerticalAlignment="Top" Visibility="Visible" />
					<Rectangle Name="foregroundColorRect" Fill="{Binding BranchStyle.ForegroundBrush, Mode=TwoWay}" Stroke="Black" HorizontalAlignment="Left" Style="{StaticResource ColorPickerRectangleStyle}" Margin="111,0,0,19" d:LayoutOverrides="HorizontalAlignment, Height" VerticalAlignment="Bottom" MouseLeftButtonUp="ForeColor_MouseLeftButtonUp" />
					<TextBox x:Name="headingForecolorTextBox" HorizontalAlignment="Left" Text="{Binding BranchStyle.ForegroundBrush.Color, Mode=TwoWay}" Margin="236,0,0,37" VerticalAlignment="Bottom" Visibility="Visible" />
					<sdk:Label x:Name="vehicleLabel" Content="Heading colors" HorizontalAlignment="Left" Margin="8,10,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="20" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment"/>
                    <Controls:ColorPicker Name="colorPicker" Margin="375,1,30,-31" Grid.RowSpan="2" SelectedColorChanging="colorPicker_SelectedColorChanging" SelectedColorChanged="colorPicker_SelectedColorChanged" Visibility="Collapsed"></Controls:ColorPicker>
            </Grid>
			</Border>
			<HyperlinkButton x:Name="saveButton" Click="OnSave" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,140,4" Content="Save &gt;" Style="{StaticResource LinkStyle}" FontFamily="/InsuranceAdjuster;component/Fonts/Fonts.zip#Segoe UI Light" FontSize="21.333" Foreground="Black" Grid.Row="1"/>
			<HyperlinkButton x:Name="ReloadBranchStylesButton" Click="OnReloadBranchStyles" Content="Cancel &gt;" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,24,4" Style="{StaticResource LinkStyle}" FontFamily="/InsuranceAdjuster;component/Fonts/Fonts.zip#Segoe UI Light" FontSize="21.333" Foreground="Black" Grid.Row="1"/>
            <TextBlock  x:Name="Title" Grid.Row="0" Margin="0,31,0,0"  HorizontalAlignment="Left" TextWrapping="Wrap" Text="Branch Settings" Style="{StaticResource TitleStyle}" d:LayoutOverrides="Height" FontFamily="Arial"/>
    </Grid>
</UserControl>
